<?php

namespace App\Models\product;

use App\Models\BaseModel;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;

class ProductModel extends BaseModel
{
    use HasFactory, SoftDeletes;

    protected $table = 'product';
    protected $primaryKey = 'id';
    public $timestamps = true;
    public const CREATED_AT = null;
    public const UPDATED_AT = null;

    public function productClass(): \Illuminate\Database\Eloquent\Relations\BelongsTo
    {
        return $this->belongsTo(ProductClassModel::class, 'class_id', 'id');
    }

    public function productPlatform(): \Illuminate\Database\Eloquent\Relations\BelongsTo
    {
        return $this->belongsTo(ProductPlatformModel::class, 'platform_id', 'id');
    }

    public function productCourse(): \Illuminate\Database\Eloquent\Relations\BelongsTo
    {
        return $this->belongsTo(ProductCourseModel::class, 'course_id', 'id');
    }
}
